﻿@model IEnumerable<HotelManageSystem.Models.RoomTypeInfoModel>

@{
    ViewBag.Title = "ShowAllRoomType";
    Layout = "~/Views/Shared/_Template2.cshtml";
}

@section Head{
      <link href="../../Content/TelerikGrid.css" rel="stylesheet" type="text/css" />
}
@{
    Html.Telerik().Grid(Model)
      .Name("Grid")
      .DataKeys(key => key.Add(r => r.ID))
      .ToolBar(command => command.Insert())
      .DataBinding(dataBind => dataBind.Ajax()
                                   .OperationMode(GridOperationMode.Client)
                                   .Select("TelerikAjax", "RoomType")
                                   .Update("UpdateRoomType", "RoomType")
                                   .Delete("DeleteRoomType", "RoomType")
                                   .Insert("AddRoomType", "RoomType")
      )

      .Pageable(page => page
                            .Style(GridPagerStyles.NextPreviousAndNumeric)
                            .Position(GridPagerPosition.Bottom)
                            .PageSize(6))
      .Columns(columns =>
      {
          columns.Bound(r => r.ID).Title("编号").Width(100).HtmlAttributes(new { style = "text-align: center" });
          columns.Bound(r => r.Name).Title("房间类型名称").Width(100).HtmlAttributes(new { style = "text-align:center" });
          columns.Bound(r => r.Price).Title("入住价格").Width(100).HtmlAttributes(new { style = "text-align:center" });
          columns.Bound(r => r.Remark).Title("备注").Width(100).HtmlAttributes(new { style = "text-align:center" });
          columns.Command(commands => { commands.Edit().ButtonType(GridButtonType.ImageAndText); commands.Delete().ButtonType(GridButtonType.ImageAndText); }).Width(200).Title("操作");
      }
              )
   .Editable(e => e.Mode(GridEditMode.PopUp))
   .Selectable()
   .Filterable()
   .Sortable()
   .Render();
    
    
}